<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Real Estate Builders Free Responsive Website Templates - icon">
    <meta name="author" content="webThemez.com">
    <title>欢迎来到拴马桩</title>
    <link rel="favicon" href="assets/images/favicon.png">
    <link rel="stylesheet" media="screen" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,700">
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/css/font-awesome.min.css">
    <!-- Custom styles for our template -->
    <link rel="stylesheet" href="assets/css/bootstrap-theme.css" media="screen">
    <link rel="stylesheet" type="text/css" href="assets/css/isotope.css" media="screen" />
    <link rel="stylesheet" href="assets/js/fancybox/jquery.fancybox.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="assets/css/style.css">
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="assets/js/html5shiv.js"></script>
    <script src="assets/js/respond.min.js"></script>
    <![endif]-->
    <link rel="shortcut icon" href="Imperial/assets/img/logo.php">
    <link href="assets/css/detail.css" rel="stylesheet">
    <link href="assets/css/personalDetail.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script th:src="@{/webjars/jquery/3.6.0/dist/jquery.js}"></script>
    <link rel="stylesheet" type="text/css" href="assets/css/ShoppingCart.css"/>
    <link rel="stylesheet" th:href="@{/webjars/layui/2.5.7/css/layui.css}">
    <script th:src="@{/webjars/layui/2.5.7/layui.js}"></script>
</head>

<body>
<!-- Fixed navbar -->
<div th:replace="~{commons/commons::topbar(active='selling')}"></div>
<!-- /.navbar -->

<header id="head" class="secondary">
    <div class="container">
        <div class="row">
            <div class="col-sm-8">
                <h1>Our Projects</h1>
            </div>
        </div>
    </div>
</header>
<br>
<br>
<div th:replace="~{commons/commons::menunav(selected='owner')}"></div>
<div th:switch="${msg}">
<form th:case="请业主身份认证" class="layui-form layui-form-pane" style="margin: 20px 50px;" id="app">
    <div class="mycss" align="center" style="height: 600px;margin-bottom: 200px" id="mycss">
        <div style="padding:50px; float: left;font-size: 25px;" >
            <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                城市</b>
            <div class="layui-input-inline">
                <input readonly type="text" class="layui-input" value="浙江省杭州市">
            </div>
        </div>
        <div style="padding:50px; float: left;font-size: 25px;" >
            <b>房产证复印件图片</b>
            <button type="button" class="layui-btn" id="upload">
                <i class="layui-icon">&#xe67c;</i>上传图片
            </button>
<!--            <div class="layui-input-inline">-->
<!--                <input type="text" class="layui-input" v-model="rname">-->
<!--            </div>-->
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        </div>
        <div style="display: none" id="imageControl">
            <b style="position: absolute;bottom: 200px;right: 905px;font-size: 25px;">图片预览</b>
            <div class="layui-input-block" id="imagedisplay">
                <img id="image" style="width: 300px;height: 300px;">
            </div>
        </div>
        <div style="padding:50px; float: left;font-size: 25px;" >
            <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;详细地址</b>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" v-model="rnumber">
            </div>
        </div>

        <button class="layui-btn" type="button" style="position: absolute;bottom: 20px;right: 725px" @click="tijiao" id="mybtn">提交信息</button>
    </div>
</form>

    <h1 th:case="请先实名认证在申请业主省份" align="center" style="height: 500px">请先实名认证在申请业主身份</h1>
    <h1 th:case="您已成功业主身份认证" align="center" style="height: 500px">您已成功认证业主身份</h1>
    <h1 th:case="业主身份待审核" align="center" style="height: 500px">业主身份待审核</h1>

</div>
<footer id="footer" >

    <div class="footer2" >
        <div class="container">
            <div class="row">

                <div class="col-md-6 panel">
                    <div class="panel-body">
                        <p class="simplenav">
<!--                            <a href="index.html">Home</a> |-->
<!--                            <a href="about.html">About</a> |-->
<!--                            <a href="services.html">Services</a> |-->
<!--                            <a href="price.html">Price</a> |-->
<!--                            <a href="projects.html">Projects</a> |-->
<!--                            <a href="contact.html">Contact</a>-->
                        </p>
                    </div>
                </div>

                <div class="col-md-6 panel" >
                    <div class="panel-body">
                        <p class="text-right">
                            Copyright &copy; 2021. Template by Shuanmazhuang
                        </p>
                    </div>
                </div>

            </div>
            <!-- /row of panels -->
        </div>
    </div>
</footer>
</body>
</html>
<script>
    let app=new Vue({
        el:'#app',
        data:{
            rnumber:''
        },
        methods:{
            tijiao:function () {
                let that =this;
                if (this.rnumber==""){
                    layui.use('layer',function () {
                        layer.msg("地址不能为空");
                    })
                    return ;
                }
                $.post({
                    url:'/addOwner',
                    data:{
                        'rnumber':that.rnumber
                    },
                    success: function (res) {
                        layui.use('layer',function () {
                            layer.msg(res);
                        })
                    }
                })
            }
        }
    })
    layui.use('upload', function(){
        let upload = layui.upload;
        let $=layui.$;
        //执行实例
        let uploadInst = upload.render({
            elem: '#upload' //绑定元素
            ,url: '/uploadImage' //上传接口
            ,done: function(res){
                //上传完毕回调
                $("#imageControl").attr("style","display: block");
                $("#mycss").attr("style","height: 900px");
                $("#mybtn").attr("style","position: absolute;bottom: -250px;right: 725px")
                let imagepath=res.map.src;
                $("#image").attr("src",imagepath);
                layer.msg("上传成功");
            }
            ,error: function(){
                //请求异常回调
            }
        });
    });
</script>
